seaweedfs 文件系统

单机部署seaweedfs

获取配置文件

docker run --rm chrislusf/seaweedfs scaffold -config=security >> ./config/security.toml

单个master

	# 9333 端口不开,通过nginx basic_auth 代理进来,为了安全
	# 分布式部署是,可以根据防火墙控制源ip访问
	docker run -dit --name filesys.master \
		-v `pwd`:/master \
		-v `pwd`/config/:/etc/seaweedfs \
		--network=host \
		-p 9333:9333 -p 19333:19333 \
		chrislusf/seaweedfs master -mdir=/master

多个volume

	## filesys.volume.01
	docker run -dit --name filesys.volume.01 \
		-v `pwd`:/data -v `pwd`/config/:/etc/seaweedfs \
		--network=host -p 8801:8080 \
		chrislusf/seaweedfs volume \
		-dir=/data -publicUrl=192.168.3.79:8801

	## filesys.volume.02
	docker run -dit --name filesys.volume.02 \
		-v `pwd`:/data -v `pwd`/config/:/etc/seaweedfs \
		--network=host -p 8802:8080 \
		chrislusf/seaweedfs volume \
		-dir=/data -publicUrl=192.168.3.79:8802

二进制安装

	#master
	nohup ./weed master -mdir=./master &

	#volume 01
	nohup ./weed volume -dir=./volume1/ -publicUrl=118.190.246.217:9530 -port=9530 &

配置 nginx basic_auth

	# 生成用户和密码
	htpasswd -c user.db anorz

	# 伪静态
	location / {  
		auth_basic            "Password please";
		auth_basic_user_file   /www/user.db;
    		proxy_pass	       http://127.0.0.1:9333;
	}

   	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    	{	
        	auth_basic            "Password please";
        	auth_basic_user_file   /www//user.db;
        	proxy_pass	       http://127.0.0.1:9333;
        	expires      30d;
        	error_log off;
        	access_log /dev/null;
   	}
    	location ~ .*\.(js|css)?$
    	{
    		auth_basic            "Password please";
        	auth_basic_user_file  /www/user.db;
        	proxy_pass	      http://127.0.0.1:9333;
        	expires      12h;
        	error_log off;
        	access_log /dev/null;
    	}
	

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×